# 统计字符：从键盘输入一个字符串，统计这个字符串当中包含几个大写字母，几个小写字母，几个数字，几个特殊符号。
def string_stat(str):
    a = 0
    b = 0
    c = 0
    d = 0
    for i in range(0,len(str)):
        m = ord(str[i])
        if m >= 65 and m <= 90:
            a += 1
        elif m >= 97 and m <= 122:
            b += 1
        elif m >= 48 and m <= 57:
            c += 1
        else:
            d += 1
    # print("大写字母个数：%d" % a)
    # print("小写字母个数：%d" % b)
    # print("数字个数：%d" % c)
    # print("特殊符号个数：%d" % d)
    return "大写：%d,小写：%d,数字：%d,其他：%d" %(a,b,c,d)

v = string_stat("sf@#AD2F54")
print(v)